Skip to content

Unify AI providers: Agent SDK OAuth + remove Claude Code CLI#73

Merged
luokerenx4 merged 5 commits intomasterfrom
dev
Mar 18, 2026
Merged

Unify AI providers: Agent SDK OAuth + remove Claude Code CLI#73
luokerenx4 merged 5 commits intomasterfrom
dev

Conversation

@luokerenx4
Copy link
Contributor

Summary

  • Agent SDK OAuth login — new loginMethod config field (api-key / claudeai). When set to claudeai, Agent SDK uses local Claude Code OAuth login (Claude Pro/Max subscription) instead of API key. No API key needed.
  • Remove Claude Code CLI provider — deleted src/ai-providers/claude-code/ entirely. Agent SDK replaces it with better tool delivery (in-process MCP vs broken external HTTP MCP). Config migration auto-converts backend: 'claude-code'agent-sdk + claudeai on startup.
  • Revert MCP server to per-request mode — fixes "No such tool" errors caused by stateful transport reuse. The SDK's stateless transport is one-shot by design.
  • Frontend Card UI — backend selector and auth mode use card-based selectors with icons and descriptions instead of plain tabs. "Agent SDK" renamed to "Claude" throughout UI.
  • Docs — README and CLAUDE.md updated to reflect 2-provider architecture.

Test plan

  • Set backend: 'agent-sdk', loginMethod: 'claudeai', verify OAuth login works
  • Set loginMethod: 'api-key' with Anthropic key, verify API key mode works
  • Existing backend: 'claude-code' config auto-migrates on startup
  • MCP tools accessible from VS Code via external MCP server (port 3001)
  • Frontend shows Claude / Vercel AI SDK cards, auth mode cards
  • Per-channel loginMethod override works in ChannelConfigModal
  • npx tsc --noEmit passes (backend + frontend)

🤖 Generated with Claude Code

luokerenx4 and others added 5 commits March 18, 2026 21:01
McpServer and transport are now created once at startup instead of
per-request, following the official MCP SDK pattern. Fixes intermittent
"No such tool available" errors caused by transient failures during
per-request server recreation.

Add setOnConfigChange() in config layer — all config write paths
(writeConfigSection, writePlatformsConfig, writeAccountsConfig) now
trigger a callback. main.ts registers mcpPlugin.restart() so MCP
tool list stays in sync after any config change.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Revert MCP server to per-request transport (stateless SDK transport
cannot be reused across requests). Fixes "No such tool" errors.

Add loginMethod field to AI provider config: 'api-key' (default) or
'claudeai' (Claude Pro/Max via local Claude Code OAuth login). When
claudeai is selected, Agent SDK strips ANTHROPIC_API_KEY from env and
passes forceLoginMethod to the SDK, enabling API-key-free operation.

Frontend: auth mode selector on AIProviderPage when agent-sdk backend
is active, per-channel loginMethod override in ChannelConfigModal.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Delete src/ai-providers/claude-code/ — Agent SDK replaces it entirely.
Both spawn the same claude CLI under the hood, but Agent SDK delivers
tools via in-process MCP (no external HTTP server needed).

GenerateRouter drops the claudeCode parameter; 'claude-code' in config
or per-request override is now an alias for 'agent-sdk'. Config migration
in loadConfig() auto-converts backend: 'claude-code' → 'agent-sdk' +
loginMethod: 'claudeai' on startup.

Frontend reduced to two backend tabs: Agent SDK | Vercel AI SDK.
Telegram compaction switched from askClaudeCode to askAgentSdk.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Mutation tools (closePosition, modifyOrder, cancelOrder) now remind AI
to call tradingCommit before tradingPush. tradingPush returns an explicit
error when staged-but-uncommitted ops exist. Frontend push panel shows
uncommitted staged operations with a yellow indicator.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…E.md

Frontend: backend selector uses card UI with icons and descriptions
instead of plain tabs. Auth section also uses cards with contextual
hints (claude login instructions vs API key input). "Agent SDK" label
replaced with "Claude" throughout UI.

README: update features, architecture diagram (2 providers instead of
3), quick start, config table, and project structure to reflect Claude
Code CLI provider removal. CLAUDE.md directory tree and architecture
description updated to match.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@luokerenx4 luokerenx4 merged commit 7f3096f into master Mar 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant